<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
</head>

<body>
    <div id="app">
        <h1>喜欢的食物</h1></h1>
        <input type="checkbox" value="香蕉" v-model="likeFoods"/>香蕉
        <input type="checkbox" value="李子" v-model="likeFoods"/>李子
        <input type="checkbox" value="葡萄" v-model="likeFoods"/>葡萄
        <input type="checkbox" value="柚子" v-model="likeFoods"/>柚子
        <input type="checkbox" value="火龙果" v-model="likeFoods"/>火龙果
        <hr/>
        <input type="checkbox" v-model="isSelected" value="isSelected">同意此协议
        <input type="checkbox" v-model="isSelectedOne" value="协议">同意此协议n
        <p>阅读人{{isSelected ? '同意' : '不同意'}}签署协议</p>
    </div>
    <script>
        Vue.config.productionTip = false;
        
        const vm = new Vue({
            el: "#app",
            data() {
                return {
                    likeFoods: [] ,//同一类型的用数组存储，
                    isSelected: false, //当只有一个选项时，用布尔值存贮
                    isSelectedOne: '',// 测试用字符串存储，不可行
                }
            }
        })
</script>
</body>

</html>